import { createRouter, createWebHistory } from 'vue-router';
import MyIndex from '@/views/index/myIndex.vue';
import Clazz from '@/views/clazz/index.vue';
import StuIndex from '@/views/stu/stuIndex.vue';
import DeptIndex from '@/views/dept/deptIndex.vue';
import EmpIndex from '@/views/emp/empIndex.vue';
import EmpIndexReport from '@/views/report/emp/empIndex.vue';
import StuIndexReport from '@/views/report/stu/stuIndex.vue';
import LogIndex from '@/views/log/logIndex.vue';
import LoginIndex from '@/views/login/loginIndex.vue';
import Layout from '@/views/layout/index.vue';

const routes = [
  { path: '/', 
    component: Layout,
    redirect: '/index',
    children: [
      { path: '/index', component: MyIndex },
      { path: '/clazz', component: Clazz },
      { path: '/stu', component: StuIndex },
      { path: '/dept', component: DeptIndex },
      { path: '/emp', component: EmpIndex },
      { path: '/report/emp', component: EmpIndexReport },
      { path: '/report/stu', component: StuIndexReport },
      { path: '/log', component: LogIndex }
    ]
  },
  { path: '/login', component: LoginIndex }
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;